from django.contrib import admin
from django.urls import re_path
from . import views,views_serializer

urlpatterns = [
    # 保存图书和获取所有图书
    # re_path(r'^books/$', views.BooksView.as_view()),
    # 获取单一图书、更新、删除
    # re_path(r'^books/(?P<pk>\d+)/$', views.BookView.as_view()),

    # ---------------序列化器的使用--------------
    re_path(r'^books/$', views_serializer.BooksView.as_view()),
    re_path(r'^books/(?P<pk>\d+)/$', views_serializer.BookView.as_view()),
]